package labox.innovation.gameserver.util;

import java.util.Random;

/**
 * 数据库回写时间间隔随机类
 * @author lian
 */
public class StoreIntervalRandom {
	private static final Random random = new Random();
	private static final int _offset = 5;

	/**
	 * 根据随机范围值、偏移量，返回随机数
	 * @param base 随机范围
	 * @param offset 偏移量
	 * @return
	 */
	public static final int getInt(int base, int offset) {
		return random.nextInt(base) + offset;
	}

	public static final int getInt(int base) {
		return getInt(base, _offset);
	}
}
